<extend name="Public/base"/>
<block name="content">
    <div class="row-fluid">
       <div class="block">
           <div class="navbar navbar-inner block-header">
               <div class="muted pull-left">
                   <if condition="ACTION_NAME eq 'add'">新增<else/>编辑</if> 机构
               </div>
           </div>
           <div class="block-content collapse in">
               <form action="__SELF__" method="post" class="form-horizontal">
                   <fieldset>
                       <div class="alert alert-error hide">
                           <button class="close" data-dismiss="alert"></button>
                           You have some form errors. Please check below.
                       </div>
                       <div class="alert alert-success hide">
                           <button class="close" data-dismiss="alert"></button>
                           Your form validation is successful!
                       </div>
                       <div class="control-group">
                           <label class="control-label">机构名称<span class="required">*</span></label>
                           <div class="controls">
                               <input name="name" type="text" class="span6 m-wrap" value="{$info.name}"/>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">Email<span class="required">*</span></label>
                           <div class="controls">
                               <input name="email" type="text" class="span6 m-wrap" value="{$info.email}"/>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">通信地址<span class="required">*</span></label>
                           <div class="controls">
                               <input name="address" type="text" class="span6 m-wrap" value="{$info.address}"/>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">联系方式<span class="required">*</span></label>
                           <div class="controls">
                               <input name="tel" type="text" class="span6 m-wrap" value="{$info.tel}"/>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">类型<span class="required">*</span></label>
                           <div class="controls">
                               <select class="span6 m-wrap" name="typeid">
                                    <volist name=":getTypeSelect()" id="vo">
                                        <eq name="key" value="$info.typeid">
                                            <option selected="selected" value="{$key}">{$vo}</option>
                                        <else/>
                                            <option value="{$key}">{$vo}</option>
                                        </eq>
                                    </volist>
                               </select>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">挂靠单位</label>
                           <div class="controls">
                               <input name="unit" type="text" class="span6 m-wrap" value="{$info.unit}"/>
                               <span class="help-block">类型如果是挂靠，请填写，若无请留空。</span>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">科技查新范围</label>
                           <div class="controls">
                               <select class="span6 m-wrap" name="categoryid">
                                   <volist name=":getCategorySelect()" id="vo">
                                       <eq name="key" value="$info.category">
                                           <option value="{$key}" selected="selected">{$vo}</option>
                                       <else/>
                                            <option value="{$key}">{$vo}</option>
                                       </eq>
                                   </volist>
                               </select>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label">城市<span class="required">*</span></label>
                           <div class="controls">
                               <select class="span6 m-wrap" name="city">
                                   <volist name=":getCitySelect()" id="vo">
                                       <eq name="key" value="$info.city">
                                           <option value="{$key}" selected="selected">{$vo}</option>
                                       <else/>
                                           <option value="{$key}">{$vo}</option>
                                       </eq>
                                   </volist>
                               </select>
                           </div>
                       </div>
                       <div class="control-group">
                           <label class="control-label" for="username">账号</label>
                           <div class="controls">
                               <input class="input-xlarge focused" name="username" id="username" type="text" value="{$info.username}">
                           </div>
                       </div>
                        <notempty name="info">
                       <input name="id"  type="hidden" value="{$info.id}">
                        </notempty>
                       <dvi class="form-action">
                           <empty name="info">
                               <button class="btn btn-primary ajax-post" type="submit" target-form="form-horizontal">
                                   增加
                               </button>
                               <else/>
                               <button class="btn btn-primary ajax-post" type="submit" target-form="form-horizontal">
                                   保存
                               </button>
                           </empty>

                       </dvi>
                   </fieldset>
               </form>
           </div>
       </div>
    </div>
</block>